package com.reger.l2cache.pipeline.ops;

import java.util.List;
import java.util.Set;

//import org.springframework.data.redis.core.Cursor;
//import org.springframework.data.redis.core.ScanOptions;
import org.springframework.lang.Nullable;

public interface RedisSetPipeline<K, M> extends RedisKeyPipeline<K> {

	@Nullable
	Long sAdd(K key, @SuppressWarnings("unchecked") M... values);

	@Nullable
	Long sRem(K key, @SuppressWarnings("unchecked") M... values);

	@Nullable
	M sPop(K key);

	@Nullable
	List<M> sPop(K key, long count);

	@Nullable
	Boolean sMove(K srcKey, K destKey, M value);

	@Nullable
	Long sCard(K key);

	@Nullable
	Boolean sIsMember(K key, M value);

	@Nullable
	Set<M> sInter(@SuppressWarnings("unchecked") K... keys);

	@Nullable
	Long sInterStore(K destKey, @SuppressWarnings("unchecked") K... keys);

	@Nullable
	Set<M> sUnion(@SuppressWarnings("unchecked") K... keys);

	@Nullable
	Long sUnionStore(K destKey, @SuppressWarnings("unchecked") K... keys);

	@Nullable
	Set<M> sDiff(@SuppressWarnings("unchecked") K... keys);

	@Nullable
	Long sDiffStore(K destKey, @SuppressWarnings("unchecked") K... keys);

	@Nullable
	Set<M> sMembers(K key);

	@Nullable
	M sRandMember(K key);

	@Nullable
	List<M> sRandMember(K key, long count);

//	Cursor<M> sScan(K key, ScanOptions options);

	default RedisSetPipeline<K, M> toSetPl() {
		return this;
	}
}
